struct ListNode* middleNode(struct ListNode* head) {
    struct ListNode* cur = head;
    struct ListNode* tail = head;
    int i = 1;
    while (cur)
    {
        if (i % 2 == 0)
        {
            tail = tail->next;
        }
        cur = cur->next;
        i++;
    }
    return tail;
}